﻿//-----------------------------------------------------------------------
// <copyright>
// This file is subject to the terms and conditions of the Microsoft Public License (MS-PL).
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL for more details.
// </copyright>
//----------------------------------------------------------------------- 
using System;

namespace Fulcrum.WeakEventManager
{
    public class WeakEventManagerGenerationDataContext : GenerationDataContext
    {
        internal WeakEventManagerGenerationDataContext(IWeakEventManagerGeneratorConfiguration generatorConfig, IWeakEventManagerConfiguration config)
        {
            this.Company = generatorConfig.Company;
            this.Copyright = generatorConfig.Copyright;
            this.Namespace = generatorConfig.Namespace;

            this.EventArgsType = config.EventArgs;
            this.EventName = config.EventName;
            this.EventSourceType = config.EventSource;
            this.ManagerName = config.Name;
        }

        public override string Name
        {
            get
            {
                return this.ManagerName;
            }
        }

        public override string TemplateFileName
        {
            get
            {
                return "WeakEventManager.t4";
            }
        }

        public override string OutputFileName
        {
            get
            {
                return String.Format("{0}.Generated", this.ManagerName);
            }
        }

        public string Company
        {
            get;
            private set;
        }

        public string Copyright
        {
            get;
            private set;
        }

        public string Namespace
        {
            get;
            private set;
        }

        public string ManagerName
        {
            get;
            private set;
        }

        public string EventSourceType
        {
            get;
            private set;
        }

        public string EventName
        {
            get;
            private set;
        }

        public string EventArgsType
        {
            get;
            private set;
        }
    }
}
